<table>
<td class="actions">
	<?php echo $this->Html->link('Aktywuj użytkowników', array('action' => 'indexActivation')); ?>
	<?php echo $this->Html->link('Dodaj użytkownika', array('action' => 'create')); ?>
	<?php 
		echo $this->Form->create('User');
		echo $this->Form->input('username', array('label'=>'Login'));
		echo $this->Form->end('Znajdź');
	?>
</td>
</table>

<table>
	<tr>
		<th><?php echo $this->Paginator->sort('id', 'Id'); ?></th>
		<th><?php echo $this->Paginator->sort('name', 'Imię'); ?></th>
		<th><?php echo $this->Paginator->sort('surname', 'Nazwisko'); ?></th>
		<th><?php echo $this->Paginator->sort('activated', 'Aktywowany'); ?></th>
		<th><?php echo $this->Paginator->sort('username', 'Login'); ?></th>
		<th>Akcje</th>
	</tr>
	<?php foreach($users as $user): ?>
	<tr>
		<td><?php echo $user['User']['id']; ?> </td>
		<td><?php echo $user['User']['name']; ?> </td>
		<td><?php echo $user['User']['surname']; ?> </td>
		<td><?php if($user['User']['activated']) {
			echo 'Tak';
		} else {
			echo 'Nie';
		} ?>
		<td><?php echo $user['User']['username']; ?> </td>
		<td class="actions">
			<?php echo $this->Html->link('Zobacz', array('action' => 'view', $user['User']['username'])); ?>
			<?php echo $this->Html->link('Edytuj', array('action' => 'edit', $user['User']['username'])); ?>
			<?php echo $this->Form->postLink('Usuń', array('action' => 'delete', $user['User']['username']), array('confirm'=>'Are you sure you want to delete that user?')); ?>
			<?php if (!$user['User']['activated']) {echo $this->Html->link('Aktywuj', array('action' => 'activate', $user['User']['id']));} ?>
		</td>
	</tr>
	<?php endforeach; ?>
</table>
<?php echo $this->Paginator->numbers(array('first'=>3,'last' => 3)); ?>


